package com.come4loves.game.dbproxy.entity;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import com.come4loves.core.dbcenter.Entity;
import com.come4loves.core.dbcenter.annotation.Column;

public class Goods extends Entity<Long> {

	private static final long serialVersionUID = 2998950420307822511L;

	@Column(pk = true)
	public long actorId;

	/**
	 * 卡牌存储字段
	 */
	@Column
	public String goods;

	@Override
	public Long getPkId() {
		return actorId;
	}

	@Override
	public void setPkId(Long pk) {
		actorId = pk;
	}

	@Override
	protected Entity<Long> readData(ResultSet rs, int rowNum) throws SQLException {
		Goods goods = new Goods();
		goods.actorId = rs.getLong("actorId");
		goods.goods = rs.getString("goods");
		return goods;
	}

	@Override
	protected void hasReadEvent() {

	}

	@Override
	protected ArrayList<Object> writeData(Boolean containsPK) {
		ArrayList<Object> values = new ArrayList<Object>();
		if (containsPK) {
			values.add(this.actorId);
		}
		values.add(this.goods);
		return values;
	}

	@Override
	protected void beforeWritingEvent() {

	}

	@Override
	protected void disposeBlob() {
		// TODO Auto-generated method stub

	}

}
